const options = {
  container: 'lucky-sheet',
  title: '企业与厂区 导入',
  lang: 'zh',
  row: 1000,
  column: 64,
  data: [
    {
      name: '企业和厂区导入',
      order: 0,
      celldata: [
        {
          r: 0,
          c: 0,
          v: {
            ct: {
              fa: 'General',
              t: 'g'
            },
            v: '操作',
            fc: '#ffffff',
            bg: '#24decc',
            vt: 0,
            ht: 0,
            tb: 0
          }
        },
        {
          r: 0,
          c: 3,
          v: {
            ct: {
              fa: 'General',
              t: 'g'
            },
            v: '企业部分',
            fc: '#ffffff',
            bg: '#6116d2',
            vt: 0,
            ht: 0,
            tb: 0
          }
        },
        {
          r: 0,
          c: 15,
          v: {
            ct: {
              fa: 'General',
              t: 'g'
            },
            v: '厂区部分',
            fc: '#ffffff',
            bg: '#de004a',
            vt: 0,
            ht: 0,
            tb: 0
          }
        },
        {
          r: 1,
          c: 3,
          v: {
            ct: {
              fa: 'General',
              t: 'g'
            },
            v: '企业名称',
            fc: '#6116d2',
            bg: '#ffffff',
            vt: 0,
            ht: 0,
            tb: 0
          }
        },
        {
          r: 1,
          c: 4,
          v: {
            ct: {
              fa: 'General',
              t: 'g'
            },
            v: '统一社会信用代码',
            fc: '#6116d2',
            bg: '#ffffff',
            vt: 0,
            ht: 0,
            tb: 0
          }
        },
        {
          r: 1,
          c: 5,
          v: {
            ct: {
              fa: 'General',
              t: 'g'
            },
            v: '联系地址',
            fc: '#6116d2',
            bg: '#ffffff',
            vt: 0,
            ht: 0,
            tb: 0
          }
        },
        {
          r: 1,
          c: 6,
          v: {
            ct: {
              fa: 'General',
              t: 'g'
            },
            v: '曾用名',
            fc: '#6116d2',
            bg: '#ffffff',
            vt: 0,
            ht: 0,
            tb: 0
          }
        },
        {
          r: 1,
          c: 7,
          v: {
            ct: {
              fa: 'General',
              t: 'g'
            },
            v: '法定代表人',
            fc: '#6116d2',
            bg: '#ffffff',
            vt: 0,
            ht: 0,
            tb: 0
          }
        },
        {
          r: 1,
          c: 8,
          v: {
            ct: {
              fa: 'General',
              t: 'g'
            },
            v: '法定代表人联系方式',
            fc: '#6116d2',
            bg: '#ffffff',
            vt: 0,
            ht: 0,
            tb: 0
          }
        },
        {
          r: 1,
          c: 9,
          v: {
            ct: {
              fa: 'General',
              t: 'g'
            },
            v: '上市情况',
            fc: '#6116d2',
            bg: '#ffffff',
            vt: 0,
            ht: 0,
            tb: 0
          }
        },
        {
          r: 1,
          c: 10,
          v: {
            ct: {
              fa: 'General',
              t: 'g'
            },
            v: '规模情况',
            fc: '#6116d2',
            bg: '#ffffff',
            vt: 0,
            ht: 0,
            tb: 0
          }
        },
        {
          r: 1,
          c: 11,
          v: {
            ct: {
              fa: 'General',
              t: 'g'
            },
            v: '监管类型',
            fc: '#6116d2',
            bg: '#ffffff',
            vt: 0,
            ht: 0,
            tb: 0
          }
        },
        {
          r: 1,
          c: 12,
          v: {
            ct: {
              fa: 'General',
              t: 'g'
            },
            v: '本地监管等级',
            fc: '#6116d2',
            bg: '#ffffff',
            vt: 0,
            ht: 0,
            tb: 0
          }
        },
        {
          r: 1,
          c: 13,
          v: {
            ct: {
              fa: 'General',
              t: 'g'
            },
            v: '正负面管理类型',
            fc: '#6116d2',
            bg: '#ffffff',
            vt: 0,
            ht: 0,
            tb: 0
          }
        },
        {
          r: 1,
          c: 14,
          v: {
            ct: {
              fa: 'General',
              t: 'g'
            },
            v: '企业标签',
            fc: '#6116d2',
            bg: '#ffffff',
            vt: 0,
            ht: 0,
            tb: 0
          }
        }
      ],
      config: {
        merge: {
          '0_0': {
            r: 0,
            c: 0,
            rs: 2,
            cs: 3
          },
          '0_3': {
            r: 0,
            c: 3,
            rs: 1,
            cs: 12
          },
          '0_15': {
            r: 0,
            c: 15,
            rs: 1,
            cs: 8
          }
        },
        rowlen: {},
        columnlen: {},
        borderInfo: {}
      }
    }
  ],
  hook: {
    workbookCreateAfter: function (config) {
      const { data: sheetList } = config
      for (const [sheetIndex, sheet] of sheetList.entries()) {
        const { celldata: cellList, config: { merge } } = sheet
        const operateColumnLen = merge['0_0'].cs
        let columnWidthConfig = {}
        for (const cellItem of cellList.filter(cellItem => cellItem.r === 1 && cellItem.c >= operateColumnLen)) {
          columnWidthConfig = { ...columnWidthConfig, ...{ [cellItem.c]: cellItem.v.v.length * 18 + 5 } }
        }
        luckysheet.setColumnWidth(columnWidthConfig, { order: sheetIndex })
      }
      console.log(config)
    }
  }
}

export default options
